package com.moli.iov.protocol.enums;

public enum CommonLockTag {
	/**
	 * 关闭
	 */
	CLOSE("关闭", 0), 
	/**
	 * 打开
	 */
	OPEN("打开", 1);

	private CommonLockTag(String key, int value) {
		this.k = key;
		this.v = value;
	}

	private String k;

	private int v;

	public static CommonLockTag valueOf(int value) {
		switch (value) {
		case 0:
			return CLOSE;
		case 1:
			return OPEN;
		default:
			return null;
		}
	}

	public static String getKey(int value) {
		for (CommonLockTag c : CommonLockTag.values()) {
			if (c.getV() == value) {
				return c.k;
			}
		}
		return null;
	}

	public String getK() {
		return k;
	}

	public int getV() {
		return v;
	}
}
